// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   analyseString.java

package include.nseer_cookie;

import java.util.StringTokenizer;

public class analyseString
{

	public analyseString()
	{
	}

	public int ana(String ss, String code)
	{
		int amount = 0;
		for (StringTokenizer tokenTO = new StringTokenizer(ss, code); tokenTO.hasMoreTokens();)
		{
			String ss1 = tokenTO.nextToken();
			amount++;
		}

		return --amount;
	}

	public boolean common(String abc)
	{
		boolean flag = true;
		String checkok = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
		for (int i = 0; i < abc.length(); i++)
		{
			if (checkok.indexOf(abc.substring(i, i + 1)) != -1)
				continue;
			flag = false;
			break;
		}

		return flag;
	}

	public String anas(String ss, String code1, String code2)
	{
		int amount = 0;
		String aa[] = new String[1000];
		String bb = "";
		for (StringTokenizer tokenTO = new StringTokenizer(ss, code1); tokenTO.hasMoreTokens();)
		{
			aa[amount] = tokenTO.nextToken();
			amount++;
		}

		for (int i = 0; i < amount; i++)
			bb = (new StringBuilder(String.valueOf(bb))).append(aa[i]).append(code2).toString();

		bb = bb.substring(0, bb.length() - code2.length());
		return bb;
	}

	public String encode(String source)
	{
		String word1[] = {
			"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", 
			"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", 
			"U", "V", "W", "X", "Y", "Z"
		};
		String word2[] = {
			"_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "_i", "_j", 
			"_k", "_l", "_m", "_n", "_o", "_p", "_q", "_r", "_s", "_t", 
			"_u", "_v", "_w", "_x", "_y", "_z"
		};
		for (int i = 0; i < word1.length; i++)
			source = source.replaceAll(word1[i], word2[i]);

		return source;
	}

	public static void main(String args[])
	{
		analyseString demo = new analyseString();
	}
}
